<?php
/**
 *  学校信息
 */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\widgets\DetailView;
use yii\bootstrap\Modal;

/* @var $this yii\web\View */
/* @var $model backend\models\School */
?>

<div style="margin-bottom: 10px">
    <?= Html::a('查看旧纪录', ['view', 'id' => $model->ID, 'flag' => 1], [
        'class' => 'btn btn-primary btn-sm',
        'style' => [
            'display' => $model->hasNoumenonRecord() && $model->ZT == '待审核' ? 'inline-block' : 'none',
        ]
    ]) ?>
    <?= Html::a('返回', ['view', 'id' => $model->ID, 'flag' => 0], [
        'class' => 'btn btn-success btn-sm',
        'style' => [
            'display' => $model->_hasShadowRecord() ? 'inline-block' : 'none',
        ]
    ]) ?>
</div>

<?= DetailView::widget([
    'model' => $model,
    'fieldRows' => [
        [
            '学校名称' => $model->ZWMC,
            '学校代码' => $model->DM,
        ],[
            '英文名称' => $model->YWMC,
            '学校类别' => $model->XXLB,
        ],[
            '属地教育部门名称' => $model->SDJYBMMC,
            '属地教育部门代码' => $model->SDJYBMDM,
        ],[
            '主管类别' => $model->ZGLB,
            '学校办别' => $model->XXBB,
        ],[
            '举办者名称' => $model->JBZMC,
            '办学类别' => $model->BXLB,
        ],[
            '法人代表名称' => $model->FRDBMC,
            '法人证书号' => $model->FRZSH,
        ],[
            '城市' => $model->CS,
            '学校行政区划码' => $model->XZQHM,
        ],[
            '区/县' => $model->QX,
            '地址代码' => $model->DZDM,
        ],[
            '地址' => $model->DZ,
            '邮政编码' => $model->YZBM,
        ],[
            '所在地区类别' => $model->SZDQLB,
            '驻地城乡类型' => $model->ZDCXLX,
        ],[
            '负责人姓名' => $model->FZRXM,
            '负责人联系电话' => $model->FZRLXDH,
        ],[
            '校长姓名' => $model->XZXM,
            '校长手机号码' => $model->XZSJH,
        ],[
            '学籍联系人' => $model->XJLXR,
            '学籍联系电话' => $model->XJLXDH,
        ],[
            '招生咨询电话' => $model->ZSZXDH,
            '招生咨询邮箱' => $model->ZSZXYX,
        ],[
            '联系电话' => $model->LXDH,
            '独立设置少数民族学校' => $model->SSMZXX?'是':'否',
        ],[
            '传真电话' => $model->CZDH,
            '附设班类型' => $model->FSBLX,
        ],[
            '电子信箱' => $model->DZXX,
            '评估类型' => $model->PGLX,
        ],[
            '主页地址' => $model->ZYDZ,
            '是否建立校园网' => $model->SFJLXYW?'是':'否',
        ],[
            '建校年月:date' => $model->JXNY,
            '状态' => $model->ZT,
        ],[
            '简介:3' => $model->JJ,
        ],
    ],
]) ?>

<p>
    <?= Html::a('审核通过', 'javascript:void(0);', [
        'class' => 'btn btn-primary btn-sm',
        'data-toggle' => 'modal',
        'data-target' => '#verified-modal',
        'style' => ['display' => $model->ZT == '待审核' ? '' : 'none'],
    ]) ?>
    <?= Html::a('退回修改', 'javascript:void(0);', [
        'class' => 'btn btn-danger btn-sm',
        'data-toggle' => 'modal',
        'data-target' => '#revise-modal',
        'style' => ['display' => $model->ZT == '待审核' ? '' : 'none'],
    ]) ?>
</p>

<!-- 审核通过模态框 -->
<?php Modal::begin([
    'id' => 'verified-modal',
    'header' => '是否通过本次审核',
    'size' => 'modal-sm',
    'bodyOptions' => [
      'class' => 'modal-body',
      'style' => 'text-align: right',
    ]]) ?>
        <?= Html::a('确定', ['verified', 'id' => $model->ID], ['class' => 'btn btn-primary']) ?>
        <?= Html::button('取消', [
            'class' => 'btn btn-default',
            'data-dismiss' => 'modal',
        ]) ?>
<?php Modal::end() ?>

<!-- 退回修改模态框（修改意见评论框）-->
<?php Modal::begin([
    'id' => 'revise-modal',
    'header' => '可在以下区域写上修改意见',
    'size' => 'modal-lg',
    'bodyOptions' => [
      'class' => 'modal-body',
      'style' => 'text-align: right',
    ]]) ?>
    <?php $form = ActiveForm::begin(); ?>
        <?= $form->field($model, 'XGYJ')->textarea([
            'rows' => 10,
            'style' => 'resize: none',
        ]) ?>
        <?= Html::submitButton('确定', ['class' => 'btn btn-primary', 'name' => 'submit-button']) ?>
        <?= Html::button('取消', [
            'class' => 'btn btn-default',
            'data-dismiss' => 'modal',
        ]) ?>
    <?php ActiveForm::end(); ?>
<?php Modal::end() ?>
